package com.celan.year2023.month01.day20;

import java.util.ArrayList;
import java.util.Scanner;

public class Main01 {

    // 计算list的几何平均值
    public static double calc_mean(ArrayList<Double> list, int start, int end) {
        double value = 1.0;
        for (int i = start; i < end; i++) {
            value *= list.get(i);
        }
        return Math.pow(value, 1.0 / (end - start));
    }

    public static void solution_01() {
        // 处理输入
        Scanner sc = new Scanner(System.in);
        String input_line = sc.nextLine();
        String[] line_list = input_line.split(" ");
        int N = Integer.parseInt(line_list[0]);
        int L = Integer.parseInt(line_list[1]);
        ArrayList<Double> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            double num = sc.nextDouble();
            sc.nextLine();
            list.add(num);
        }

        int lo = 0;     // 定义子数组的位置
        int size = 0;   // 定义子数组的大小
        double max_mean = Double.NEGATIVE_INFINITY;
        for (int i = 0; i < N - L + 1; i++) {
            for (int j = i + L; j < N + 1; j++) {
                double mean_value = calc_mean(list, i, j);
                if (mean_value - max_mean >= 1e-5) {
                    max_mean = mean_value;
                    lo = i;
                    size = j - i;
                } else if (mean_value - max_mean <= 1e-10) {
                    if (j - i < size) {
                        lo = i;
                        size = j - i;
                    }
                }
            }
        }

        System.out.println(lo + " " + size);
    }

    public static void main(String[] args) {
        solution_01();
    }
}
